# Final project: troubleshooting
Goal: Eight faults are hidden in the finished network. You find and fix them with everything you have learned in chapters 1 to 11.

## Read

### The whole network at a glance
The network from chapter 11 connects four networks: school, provider, RGG and your home network. On top of that come all routers and servers: the web server of the school with HTTPS, DNS, DHCP, two mail servers, the blog, the intranet and the VPN server. The network plan shows you what is where.

[Picture: k12-netzplan.png | The finished network with the school, provider, RGG and home networks]

The network plan is the starting point of every troubleshooting. Ask yourself: Where is the device? Where does the service run? Which routers and firewalls are in between?

> Note: When this chapter starts, Filius loads a copy of this network with eight built-in faults. Which ones is chosen at random.

### Tickets
Whoever has a problem with the network writes a **ticket** to the IT support: a short message about what does not work. A ticket only describes what the person noticed. You find the cause yourself. Often the message already contains an important hint, for example "it works with the IPv4 address, but not with the name".

### Troubleshooting like professionals
For **systematic troubleshooting**, professionals work from the bottom to the top. Every level requires the one before:

- Level 1, own settings: `ipconfig` – are address, gateway and DNS server right?
- Level 2, gateway: `ping` the own gateway.
- Level 3, destination IPv4 address: `ping` the address of the destination. If it gets stuck, `traceroute` shows at which router.
- Level 4, name: `nslookup` or `host` – does the DNS server return the right address?
- Level 5, service: Is the server running? Is the port right? Does a firewall let the connection through?

[Picture: k12-stufen.png | The five levels of troubleshooting, from the bottom to the top]

[Picture: k12-fehlersuche.png | ping, traceroute and nslookup when troubleshooting]

### Tools for level 5
- The data exchange shows whether a request arrives and whether an answer comes back. If a SYN gets no answer, nobody is waiting there, or a firewall drops the packet.
- The log of a router with a firewall shows which rule matched.
- The lock in the browser shows the certificate: who issued it, and for which names is it valid?
- The VPN client tells two cases apart: "No answer" means the VPN server cannot be reached. "Login rejected" means it can be reached, but name or password do not match.

### When is a fault fixed?
A fault is only fixed when the **end-to-end test** works: the service works from the user's device to the server. So test exactly what did not work in the ticket, on the device the ticket came from.

## Practice

### Monday morning at the IT support
Eight tickets have come in. You only see the message. A tick appears when the cause is fixed and the matching end-to-end test has worked. Then Filius shows the cause. You choose the order yourself.

### A1
Variant: 1
"No school laptop can reach anything outside the school network. They reach each other and the school mail server by ping."
Cause: The school's DHCP server handed out the gateway 192.168.10.254.
Tip: What does a school laptop have as its gateway? Where does it get it from?

### A2
Variant: 2
"From the school nobody reaches the network of the RGG, not even with ping 198.51.100.80. The DNS server in the provider network answers."
Cause: Automatic routing was switched off on the R2 RGG router.
Tip: Which networks does R1 know? Its page /routes tells you.

### A3
Variant: 2
"In the RGG office the shop page does not load, not even via 198.51.100.80. The Shop answers ping."
Cause: The web server of the Shop was stopped.
Tip: ping works, so the way is right. What else is missing?

### A4
Variant: 1, 3
"In the RGG office the Shop opens via 198.51.100.80, but not via www.ravensberger24.de."
Cause: The A record www.ravensberger24.de pointed to 198.51.100.81.
Tip: What does nslookup answer?

### A5
Variant: 1
"Anna's orders to verkauf@ravensberger24.de do not arrive. Emails to ben work."
Cause: The MX record for ravensberger24.de was missing.
Tip: host ravensberger24.de shows what the DNS server knows about the domain.

### A6
Variant: 2
"On the Home laptop web pages only open via IPv4 addresses."
Cause: The DHCP server of the Home router handed out the DNS server 203.0.113.35.
Tip: ipconfig on the Home laptop. Where does it get its values from?

### A7
Variant: 2
"The blog cannot be reached from outside via http://203.0.113.3:8080, but it works in the home network."
Cause: The port mapping pointed to 192.168.178.11.
Tip: The blog runs in the home network. What is missing on the way in from outside?

### A8
Variant: 1
"At home the Shop does not open on any device any more, not even via 198.51.100.80. In the RGG office it opens via 198.51.100.80."
Cause: The firewall rule on the Home router dropped TCP 80 from the whole home network (netmask 255.255.255.0) instead of only from the Tablet.
Tip: The log of the Home router shows which rule matches.

### A9
Variant: 2
"Nobody can retrieve emails of @rbz-wirtschaft-kiel.de, neither at school nor at home."
Cause: The email server of the school was stopped.
Tip: All users are affected. Can it be a single laptop then?

### A10
Variant: 2, 3
"Laptop-3 reaches nothing outside the school network, Laptop-1 and Laptop-2 do."
Cause: On Laptop-3 DHCP was switched off and a fixed address 192.168.10.45 with the gateway 192.168.10.100 was entered.
Tip: Compare the settings of Laptop-3 with those of Laptop-1.

### A11
Variant: 1
"The school website does not open anywhere any more, neither via https://www.rbz-wirtschaft-kiel.de nor via https://192.168.10.10. The web server answers ping."
Cause: HTTPS was switched off on the web server of the school, and HTTP has been switched off since chapter 4.
Tip: ping works. Which port belongs to https, and is anybody waiting there?

### A12
Variant: 2
"For https://www.rbz-wirtschaft-kiel.de the browser warns on every device: This connection is not secure."
Cause: The certificate of the web server was self-signed.
Tip: Click on the lock. Who issued the certificate?

### A13
Variant: 1
"Anna's mother cannot get to the emails of the sales team from home any more. The VPN client reports: Login rejected."
Cause: In the VPN server the password for verkauf was homeoffice instead of Homeoffice.
Tip: The VPN server answered. What does it check at the login?

### A14
Variant: 3
"From outside the Shop does not open any more, neither from the school nor from home, not even via 198.51.100.80. Emails to verkauf@ravensberger24.de do not arrive either. In the RGG office the Shop opens via 198.51.100.80."
Cause: Rule 1 of the firewall on R2 had the netmask 255.255.255.0 and dropped TCP to the whole network of the RGG.
Tip: It works in the office. What lies only on the way from outside?

### A15
Variant: 3
"The VPN client in the home office reports: No answer from the VPN server."
Cause: The VPN server was stopped.
Tip: No answer means: nobody is waiting at UDP port 1194.

### A16
Variant: 1, 3
"The warehouse page does not open anywhere any more, not even in the office via http://198.51.100.40."
Cause: The intranet had the IPv4 address 198.51.100.4 instead of 198.51.100.40.
Tip: Does 198.51.100.40 answer ping? Which address does the intranet have?

### A17
Variant: 2, 3
"In the office the email program of the sales team reports an error when retrieving emails. The mail server of the RGG is running."
Cause: In the email program of the Office laptop, mail.rbz-wirtschaft-kiel.de was entered as the IMAP server, the mail server of the school.
Tip: On which mail server is the mailbox verkauf? Look at the settings of the account.

### A18
Variant: 1, 3
"The blog opens neither in the home network via http://192.168.178.10 nor from outside."
Cause: The web server of the Blog server was stopped.
Tip: It does not work in the home network either. Can it be the port mapping then?

### A19
Variant: 3
"The school website does not open anywhere any more. Even ping 192.168.10.10 gets no answer, at school as well as from home."
Cause: The web server of the school had no cable to the School switch.
Tip: No ping, from anywhere. Look at the web server in the design mode.

## Quiz

### Laptop-3 opens the Shop via 198.51.100.80, but not via www.ravensberger24.de. What do you check first?
- The cable between Laptop-3 and the School switch
Wrong: Laptop-3 reaches the Shop via the IPv4 address. So the cable works.
- The gateway of Laptop-3
Wrong: With a wrong gateway, Laptop-3 would not get into the RGG network via the IPv4 address either.
- ✓ The DNS server entry of Laptop-3, then nslookup
- The firewall on the Home router
Wrong: Laptop-3 is at the school. The firewall of the Home router is not on its way at all.
Explanation: It works via the IPv4 address, so cable and gateway are right. The problem is in the name resolution.

### From Laptop-2, ping 192.168.10.1 and ping 203.0.113.53 work, but ping 198.51.100.80 does not. Where do you look?
- ✓ At the learned routes of R1 and R2 (page /routes)
- At the gateway entry of Laptop-2
Wrong: Laptop-2 reaches 203.0.113.53 in the provider network. For that its gateway must already be right.
- At the A record of the Shop on the DNS server
Wrong: A ping to an IPv4 address needs no DNS. The A record plays no role here.
- At the web server of the Shop
Wrong: A ping is answered by the device itself, not by the web server. Even a stopped web server does not prevent the ping.
Explanation: Laptop-2 gets as far as the provider network, so its gateway is right. ping needs neither DNS nor a web server. A route there or back is missing.

### Which command shows you at which router a packet gets stuck?
- ipconfig
Wrong: ipconfig only shows the own settings. It says nothing about the way through the network.
- nslookup
Wrong: nslookup asks the DNS server for a name. It does not show the way of the packets.
- arp
Wrong: arp only shows MAC addresses in the own network. Routers in other networks do not appear there.
- ✓ traceroute
Explanation: traceroute shows every station on the way. The output ends at the last station that still answered; behind it the packet gets stuck.

### In which order do you troubleshoot?
- Gateway, name, own settings, service, destination IPv4 address
Wrong: The gateway can only be checked sensibly once the own settings are right. Otherwise maybe even the own address is wrong.
- Service, own settings, name, gateway, destination IPv4 address
Wrong: Starting with the service means starting at the top. If the fault is further down, you look in the wrong place.
- ✓ Own settings, gateway, destination IPv4 address, name, service
- Name, destination IPv4 address, service, gateway, own settings
Wrong: A name only helps if the way to the destination IPv4 address works. This order goes from the top to the bottom and only gets to the own settings at the very end.
Explanation: You check from the bottom to the top, because every level requires the one before: first the own settings, then the gateway, then the destination IPv4 address, then the name and finally the service.

### The blog cannot be reached from outside, but in the home network it can. What do you check?
- The DNS record of the blog
Wrong: The blog has no DNS record at all. It is opened via 203.0.113.3:8080.
- ✓ The port mapping on the Home router
- The web server of the blog
Wrong: The blog opens in the home network. So the web server is running.
- The firewall rule for the Tablet
Wrong: This rule only blocks connections from the Tablet to the Shop. It does not affect requests from outside to the blog.
Explanation: The blog runs in the home network, so only the way in from outside is missing. The blog has no DNS record, it is opened via 203.0.113.3:8080.

### At home the school website opens via its name, but the Shop does not open on any device. In the RGG office the Shop works. What is most likely?
- The port mapping points to the wrong device
Wrong: A port mapping concerns requests from outside into the home network. But the Shop is opened from inside.
- The A record of the Shop is wrong
Wrong: The Shop works in the RGG office, and the office uses the same DNS server. So the A record is right.
- The Home router hands out a wrong DNS server
Wrong: The school website opens at home via its name. So name resolution in the home network works.
- ✓ A firewall rule on the Home router blocks too much
Explanation: Names are resolved at home, and the Shop itself is running. Only connections from the home network to the Shop fail.

### The VPN client reports "No answer from the VPN server". What is most likely?
- ✓ The VPN server is not running, or UDP port 1194 is blocked on the way
- The password is wrong
Wrong: With a wrong password the VPN server answers with "Login rejected".
- The intranet is switched off
Wrong: The intranet has nothing to do with building the tunnel. The VPN server would answer anyway.
- The DNS server does not know the VPN server
Wrong: The VPN client contains the IPv4 address of the VPN server. No DNS is needed for that.
Explanation: Without an answer, nothing arrives at the VPN server, or it is not waiting at UDP port 1194. Only a reachable VPN server sends a rejection.

### For https://www.rbz-wirtschaft-kiel.de the browser warns: This connection is not secure. The web server answers ping. Where do you look?
- ✓ At the certificate of the web server: is it self-signed, or is it valid for another name?
- At the DHCP server of the school
Wrong: The browser does reach the web server, otherwise there would be no warning at all. So address and gateway are right.
- At the port mapping of the Home router
Wrong: The port mapping only concerns requests from outside into the home network. The web server is at the school.
- At the MX record of the school
Wrong: The MX record only matters for emails. It has nothing to do with HTTPS.
Explanation: The warning comes from the TLS handshake. The browser does not trust the certificate: the signature of a known certificate authority is missing, or the name does not match.

### A SYN to 198.51.100.40, port 80, gets no answer from the Home laptop. In the RGG office the warehouse page opens. What is the reason?
- ✓ The firewall on R2 drops connections from outside to the intranet, that is intended
- The web server of the intranet is stopped
Wrong: The warehouse page opens in the office. So the web server is running.
- The Home laptop has a wrong gateway
Wrong: With a wrong gateway the SYN would not even get out of the home network. That is not the obvious cause here.
- The DNS server does not know the intranet
Wrong: The SYN goes to an IPv4 address. DNS plays no role here.
Explanation: The intranet is meant to be blocked from outside. From home you only get in through the VPN.

### What is an end-to-end test?
- ✓ A test whether a service works from the user's device to the server
- A ping from the gateway to the last router
Wrong: An end-to-end test starts at the user's device and ends at the service, not at routers in between. Besides, a ping does not test a service.
- A test whether all cables are plugged in at both ends
Wrong: It is not about cable ends, but about whether the whole way from the user to the service works.
- A test whether the server is waiting on its port
Wrong: That only checks one end. Only the test from the user's device shows whether the user also reaches the server.
Explanation: An end-to-end test checks the service the way the user uses it, from the own device to the server. Only when it works is a fault really fixed.

## Glossary

- **Ticket** – short message to the IT support about what does not work. It describes the symptom from the person's view, not the cause. Good tickets name the device and what exactly does not work, for example "via the IPv4 address yes, via the name no".
- **Systematic troubleshooting** – checking from the bottom to the top: own settings, gateway, destination IPv4 address, name, service. Every level requires the one before: without the right own address even the best gateway does not help. Suitable tools are ipconfig, ping, traceroute and nslookup, and for the service the data exchange. This way you find a fault faster than by searching everywhere at once.
- **End-to-end test** – checks a service from the user's device to the server across all networks. For example, you really open the Shop in the browser of the affected laptop. Only when this test works is a fault fixed. A ping alone is not enough, because it does not test a service.
